package com.example.back.impl;

import com.example.back.mapper.ScenarioMapper;
import com.example.back.model.Boardgame;
import com.example.back.model.Scenario;
import com.example.back.service.ScenarioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ScenarioServiceImpl implements ScenarioService {

    @Resource
    private ScenarioMapper scenarioMapper;

    @Override
    public List<Scenario> findAllScenario() {
        return scenarioMapper.findAllScenario();
    }

    @Override
    public List<Scenario> selectKCount(int kCount) {
        return scenarioMapper.selectKCount(kCount);
    }

    @Override
    public List<Scenario> selectKName(String name) {
        return scenarioMapper.selectKName(name);
    }

    @Override
    public Boolean insertScenario(String name, String introduction, int lowerLimit, int upperLimit, int position) {
        return scenarioMapper.insertScenario(name, introduction, lowerLimit, upperLimit, position);
    }

    @Override
    public Boolean updateScenario(int id, int position) {
        return scenarioMapper.updateScenario(id, position);
    }

    @Override
    public Boolean deleteScenario(int id) {
        return scenarioMapper.deleteScenario(id);
    }

    @Override
    public String findPhotoByID(int id) {
        return scenarioMapper.findPhotoByID(id);
    }
}
